/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package foalvleditor.gameobjects;

import java.awt.Point;

/**
 *
 * @author Mikael
 */
public class GameObjectFactory{

       public enum GameObjectType{
           Door, Enemy, Gravitable, Key, Lever, PlayerObject, Push,
           ReverseGravitable, Scenery, Spike, StationaryObstacle,
           TiltableObject
       }


public static AbstractGameObject createGameObject(GameObjectType objectType,
        Point position, Bitmap bitmap, int layer){
        switch (objectType){
            case Door:
                return new Door(position, bitmap, layer);
            case Enemy:
                return new Enemy(position, bitmap, layer);
            case Gravitable:
                return new Gravitable(position, bitmap, layer);
            case Key:
                return new Key(position, bitmap, layer);
            case Lever:
                return new Lever(position, bitmap, layer);
            case PlayerObject:
                return new PlayerObject(position, bitmap, layer);
            case Push:
                return new Push(position, bitmap, layer);
            case ReverseGravitable:
                return new ReverseGravitable(position, bitmap, layer);
            case Scenery:
                return new Scenery(position, bitmap, layer);
            case Spike:
                return new Spike(position, bitmap, layer);
            case StationaryObstacle:
                return new StationaryObstacle(position, bitmap, layer);
            case TiltableObject:
                return new TiltableObject(position, bitmap, layer);
        }
        throw new IllegalArgumentException("Bad argument");
	}
}